Skip to content

Add support for reordering Shopping List Items via Drag and Drop#41585

Merged
bramkragten merged 11 commits intohome-assistant:devfrom
ShaneQi:feature/drag-and-drop-in-shopping-list
Jan 5, 2021
Merged

Add support for reordering Shopping List Items via Drag and Drop#41585
bramkragten merged 11 commits intohome-assistant:devfrom
ShaneQi:feature/drag-and-drop-in-shopping-list

Conversation

@ShaneQi
Copy link
Copy Markdown
Contributor

@ShaneQi ShaneQi commented Oct 10, 2020

Proposed change

Adding reordering shopping list items web socket to support drag and drop in shopping list card.

The drag and drop front end pr: home-assistant/frontend#7296

Kapture 2020-10-10 at 01 25 26

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

N/A

Additional information

  • This PR fixes or closes issue: N/A
  • This PR is related to issue: N/A
  • Link to documentation pull request: N/A

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • [N/A] The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • [N/A] New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • [N/A] Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@ShaneQi ShaneQi marked this pull request as ready for review October 10, 2020 06:26
@springstan springstan changed the title Added Reordering Shopping List Items to Support Shopping List Drag and Drop Add support for reordering Shopping List Items via Drag and Drop Oct 10, 2020
)
new_items.append(all_items_mapping[key])
self.items = new_items
self.hass.async_add_job(self.save)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use async_add_executor_job

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

)
except vol.Invalid as err:
connection.send_message(
websocket_api.error_message(msg_id, "bad_request", f"{err}")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the websocket_api error ERR_INVALID_FORMAT

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

)
)
except vol.Invalid as err:
connection.send_message(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also use send_error

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this and the above 2 issues.

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Can be merged once frontend is 👍

@ShaneQi
Copy link
Copy Markdown
Contributor Author

ShaneQi commented Oct 28, 2020

@balloob Front end PR had been reviewed by Zack.
@zsarnett Do you think we can start looking at merging?

@zsarnett
Copy link
Copy Markdown
Contributor

I'll review again and merge

@bramkragten bramkragten merged commit c654476 into home-assistant:dev Jan 5, 2021
@ShaneQi
Copy link
Copy Markdown
Contributor Author

ShaneQi commented Jan 5, 2021

Wanted to leave a comment that if there are issues in the future, please remind me, I'd be happy to help.

@bramkragten
Copy link
Copy Markdown
Member

Thanks @ShaneQi! That is really appreciated. Would you want to add yourself as a code owner for this integration?

@ShaneQi
Copy link
Copy Markdown
Contributor Author

ShaneQi commented Jan 7, 2021

Thanks @ShaneQi! That is really appreciated. Would you want to add yourself as a code owner for this integration?

Sure, it's an honor.

Thomas55555 pushed a commit to Thomas55555/core that referenced this pull request Feb 24, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants